package hasthi.container.p2p;

import hasthi.common.HasthiException;
import hasthi.container.CommunicationClient;
import hasthi.container.CommunicationContianier;
import hasthi.container.MessageContext;
import hasthi.container.NodeAddress;

import java.util.Collection;

import org.apache.xmlbeans.XmlObject;

public interface MulticastContianier extends CommunicationContianier{
    /**
     * Send the message to a randomly picked entry in the routing table, and
     * wait for a response
     * 
     * @param messageContext
     * @return
     * @throws HasthiException
     */
    public abstract XmlObject anyCastAndReceive(MessageContext messageContext)
            throws HasthiException;

//    public abstract Collection<XmlObject> broadcastAndWait(XmlObject message, String soapAction,
//            long waitTimeInMs, int expectedResponseCount) throws InterruptedException;
    public Collection<XmlObject> mulitiCastAndWait(XmlObject message, String soapAction,
            long waitTimeInMs, int expectedResponseCount) throws InterruptedException;
}